<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<h:head> 
	<title>TravelDream - Lista Regali </title>
</h:head> 
<body> 
	<h1>Lista Regali di #{UserBean.selectedUser.nome} </h1>
	<h:form>
		<p:selectManyCheckbox id="lista" value="#{UserBean.selectedGifts}"  layout="grid" columns="1" >  
	    	<f:selectItems value="#{UserBean.giftList}" />
	    </p:selectManyCheckbox> 
	     
	    <p:commandButton value="Regala"  actionListener="#{UserBean.regala}" rendered="true" update="lista">
	    	<p:confirm header="Regala" message="Richiedere l'acquisto degli elementi selezionati?" icon="ui-icon-alert"/>
	    </p:commandButton>
	    <p:commandButton value="OK" action="index" rendered="true"/>
	    <p:confirmDialog rendered="true" global="true" showEffect="fade" hideEffect="explode">  
	       	<p:commandButton rendered="true" value="Si" update="lista" styleClass="ui-confirmdialog-yes" icon="ui-icon-check"/> 
	        <p:commandButton rendered="true" value="No"  styleClass="ui-confirmdialog-no" icon="ui-icon-close"/>       
	    </p:confirmDialog>  
    </h:form>

</body> 
</html>
